package com.dwx.guli.service.edu.controller.admin;


import com.dwx.guli.service.base.result.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Slf4j
@RequestMapping("/user")
public class LoginController {
    @PostMapping("/login")
    public R login(){
        return R.ok().data("token","admin");
    }
    /**
     * 获取用户信息
     * @return
     */
    @GetMapping("/info")
    public R info() {

        return R.ok()
                .data("roles","[admin]")
                .data("name","admin")
                .data("avatar","https://oss.aliyuncs.com/aliyun_id_photo_bucket/default_handsome.jpg");
    }

    /**
     * 退出
     * @return
     */
    @PostMapping("logout")
    public R logout(){
        return R.ok();
    }
}
